package com.inspur.mr.electric;

import java.io.DataInput;
import java.io.DataOutput;
import java.io.IOException;

import org.apache.hadoop.io.Writable;

public class ElectricWritable implements Writable {
	private String year;
	private double cf;
	private double xyf;
	private double kt;
	private double sum;
	
	public void write1(DataOutput out) throws IOException {
		out.writeUTF(year);
		out.writeDouble(cf);
		out.writeDouble(xyf);
		out.writeDouble(kt);
		out.writeDouble(sum);
		
	}


	public void readFields1(DataInput in) throws IOException {
		year = in.readUTF();
		cf = in.readDouble();
		xyf = in.readDouble();
		kt = in.readDouble();
		sum = in.readDouble();
	}

	public ElectricWritable() {

	}
public ElectricWritable(String year,double cf,double xyf,double kt,double sum) {
	this.year = year;
	this.cf = cf;
	this.xyf = xyf;
	this.kt = kt;
	this.sum = sum;
}
	public String getYear() {
		return year;
	}

	public void setYear(String year) {
		this.year = year;
	}

	public double getCf() {
		return cf;
	}

	public void setCf(double cf) {
		this.cf = cf;
	}

	public double getXyf() {
		return xyf;
	}

	public void setXyf(double xyf) {
		this.xyf = xyf;
	}

	public double getKt() {
		return kt;
	}

	public void setKt(double kt) {
		this.kt = kt;
	}

	public double getSum() {
		return sum;
	}

	public void setSum(double sum) {
		this.sum = sum;
	}
	@Override
	public void write(DataOutput out) throws IOException {
		// TODO Auto-generated method stub
		
	}
	@Override
	public void readFields(DataInput in) throws IOException {
		// TODO Auto-generated method stub
		
	}


	@Override
	public String toString() {
		return "ElectricWritable [cf=" + cf + ", xyf=" + xyf + ", kt=" + kt + ", sum=" + sum + "]";
	}

	

}
